package com.lz.library.dialog

import android.app.Dialog
import android.content.Context
import android.os.Bundle
import android.view.KeyEvent
import com.lz.library.R

/**
 *  author: you : 2020/4/24
 */

class ProgressDialog(context: Context) : Dialog(context, R.style.lib_dialogTheme) {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.lib_dialog_loading)
        setCanceledOnTouchOutside(false)
        this.window!!.setBackgroundDrawableResource(R.drawable.lib_bg_pbloading)
    }

    override fun onKeyDown(keyCode: Int, event: KeyEvent): Boolean {
        if (keyCode == KeyEvent.KEYCODE_BACK) return true
        return super.onKeyDown(keyCode, event)
    }
    
}